#介绍用Python读取csv文件csv（Comma-Separated Values）
import csv

with open(r'../Files/sample.csv') as csvfile:
    readCSV = csv.reader(csvfile, delimiter=',')
    print("打印所有行：")
    for row in readCSV:
        print(row)

with open(r'../Files/sample.csv') as csvfile:
    readCSV = csv.reader(csvfile, delimiter=',')
    print("打印第一列：")
    for row1 in readCSV:
        print(row1[0])

with open(r'../Files/sample.csv') as csvfile:
    readCSV = csv.reader(csvfile, delimiter=',')
    print("打印第一到第二列：")
    for row2 in readCSV:
        print(row2[0],row2[1])

with open('../Files/sample.csv') as csvfile:
    readCSV = csv.reader(csvfile, delimiter=',')
    regions = [ ]
    boards = [ ]
    topics = [ ]
    for row3 in readCSV:
        region = row3[0]
        board = row3[1]
        topic = row3[2]

        regions.append(region)
        boards.append(board)
        topics.append(topic)

    print(regions)
    print(boards)
    print(topics)